from multiprocessing import Manager, Process
def foo(d, l):  # manager获取的字典，列表操作
    d[0] = 1
    d["key"] = "value"
    l.reverse()
if __name__ == "__main__":
    # 使用manager
    with Manager() as manager:
        #  Manager()返回的manager提供list, dict等类型支持
        dict = manager.dict()
        list = manager.list(range(10))
        print(list)
        p = Process(target=foo, args=(dict, list))
        p.start()
        p.join()
        print(dict)
        print(list)

